'use strict';

var dbm;
var type;
var seed;

/**
  * We receive the dbmigrate dependency from dbmigrate initially.
  * This enables us to not have to rely on NODE_PATH.
  */
exports.setup = function(options, seedLink) {
  dbm = options.dbmigrate;
  type = dbm.dataType;
  seed = seedLink;
};

exports.up = function(db,callback) {
   db.createTable('house',{
     id: { type: 'int', primaryKey: true, autoIncrement: true },
     name:{type:'string',notNull:true},
     estate: {type:'string',notNull:true},
     city:{type:'string',notNull:true},
     iscoupon:{type:'boolean'},
     address: {type:'string',notNull:true},
     lable:{type:'string'},
     imgList:{type:'string'},
     price:{type:'int',notNull:true},
     view:{type:'int'},
     wei_price:{type:'int',notNull:true},
     vr_url:{type:'string'},
     naviaid:{type:'string'},
     telphone:{type:'string'},
     created_at:{type:'timestamp',defaultValue: 'CURRENT_TIMESTAMP'},
     deleted_at:{type:'timestamp'}
  },callback);
};

exports.down = function(db) {
  return null;
};

exports._meta = {
  "version": 1
};
